home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
CIncludes
/
Folders.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-05-01
|
8KB
|
239 lines
/*
File: Folders.h
Contains: Folder Manager Interfaces.
Version: Technology: Some
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
*/
#ifndef __FOLDERS__
#define __FOLDERS__
#ifndef __TYPES__
#include <Types.h>
#endif
#ifndef __CODEFRAGMENTS__
#include <CodeFragments.h>
#endif
#if FOR_SYSTEM8_PREEMPTIVE
#ifndef __FILEMANAGERTYPES__
#include <FileManagerTypes.h>
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import on
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=mac68k
#endif
#if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
enum {
kOnSystemDisk = 0x8000,
kCreateFolder = true,
kDontCreateFolder = false,
kSystemFolderType = 'macs', /* the system folder */
kDesktopFolderType = 'desk', /* the desktop folder; objects in this folder show on the desk top. */
kTrashFolderType = 'trsh', /* the trash folder; objects in this folder show up in the trash */
kWhereToEmptyTrashFolderType = 'empt', /* the "empty trash" folder; Finder starts empty from here down */
kPrintMonitorDocsFolderType = 'prnt', /* Print Monitor documents */
kStartupFolderType = 'strt', /* Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here */
kShutdownFolderType = 'shdf', /* Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here */
kAppleMenuFolderType = 'amnu', /* Finder objects to put into the Apple menu go here */
kControlPanelFolderType = 'ctrl', /* Control Panels go here (may contain INITs) */
kExtensionFolderType = 'extn', /* Finder extensions go here */
kFontsFolderType = 'font', /* Fonts go here */
kPreferencesFolderType = 'pref', /* preferences for applications go here */
kTemporaryFolderType = 'temp' /* temporary files go here (deleted periodically, but don't rely on it.) */
};
extern pascal OSErr FindFolder(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID)
TWOWORDINLINE(0x7000, 0xA823);
extern pascal OSErr ReleaseFolder(short vRefNum, OSType folderType)
TWOWORDINLINE(0x700B, 0xA823);
#endif
#if FOR_SYSTEM8_PREEMPTIVE
/******************************************/
/* Extensible Folder Manager declarations */
/******************************************/
/****************************/
/* Folder Manager constants */
/****************************/
/* new gestalt constants for gestalt FindFolderAttr (to be moved to Gestalt.h) */
enum {
gestaltFolderDescSupport = 1 /* has FolderDesc calls */
};
/* new Folder Manager error codes */
enum {
badFolderDescErr = -4270,
duplicateFolderDescErr = -4271,
noMoreFolderDescErr = -4272,
invalidFolderTypeErr = -4273,
duplicateRoutingErr = -4274,
routingNotFoundErr = -4275,
badRoutingSizeErr = -4276
};
enum {
kExtensionDisabledFolderType = 'extD',
kControlPanelDisabledFolderType = 'ctrD',
kSystemExtensionDisabledFolderType = 'macD',
kApplicationsFolderType = 'apps',
kDocumentsFolderType = 'docs'
};
enum {
/* new constants */
kVolumeRootFolderType = 'root', /* root folder of a volume */
kGlobalPreferencesFolderType = 'gprf', /* preferences for all users/workspaces */
kChewableItemsFolderType = 'flnt', /* items deleted at boot */
kApplicationSupportFolderType = 'asup', /* third-party items and folders */
kSystem7SystemFolderType = '[f]blu', /* System 7 system folder */
kDebuggerExtensionsFolderType = '[f]deb', /* debugger extensions */
kDesktopModulesFolderType = '[f]dsk', /* desktop animation modules */
kEditorsFolderType = '[f]edi', /* OpenDoc editors */
kExtensionLibrariesFolderType = '[f]exl', /* leechlets */
kCoopExtensionLibrariesFolderType = '[f]cex', /* blue leechlets */
kHardwareSupportFolderType = '[f]hdw', /* hardware support */
kLocalesFolderType = '[f]loc', /* locales */
kServerLibrariesFolderType = '[f]ser', /* servers */
kSystemLibrariesFolderType = '[f]sys', /* system libraries */
kTextEncodingsFolderType = '[f]tex', /* encoding tables */
kThemesFolderType = '[f]thm', /* themes */
kStationeryFolderType = '[f]stn' /* stationery */
};
/* FolderDescFlags values */
enum {
kPersistentFolderDesc = 0x00000001,
kCreateFolderAtBoot = 0x00000002,
kFolderCreatedInvisible = 0x00000004,
kFolderCreatedNameLocked = 0x00000008
};
typedef UInt32 FolderDescFlags;
/* FolderClass values */
enum {
kRelativeFolder = 'relf',
kSpecialFolder = 'spcf'
};
typedef OSType FolderClass;
enum {
doReplace = true,
dontReplace = false
};
/* known FolderType values */
enum {
kBlessedFolder = 'blsf',
kCurrentWorkspaceFolder = 'cwsf',
kRootFolder = 'rotf',
kWorkspacesFolder = 'wksf'
};
typedef OSType FolderType;
typedef OSType FolderLocation;
struct FolderDesc {
Size descSize;
FolderType foldType;
FolderDescFlags flags;
FolderClass foldClass;
FolderType foldLocation;
OSType badgeSignature;
OSType badgeType;
UInt32 reserved;
Str63 name;
};
typedef struct FolderDesc FolderDesc;
typedef UInt32 RoutingFlags;
struct FolderRouting {
Size descSize;
OSType fileType;
FolderType routeFromFolder;
FolderType routeToFolder;
RoutingFlags flags;
};
typedef struct FolderRouting FolderRouting;
/* routing constants */
enum {
kPersistentRouting = 0x00000001
};
/***************************/
/* Folder Manager routines */
/***************************/
/* Folder Manager administration routines */
extern pascal OSErr AddFolderDescriptor(FolderType foldType, FolderDescFlags flags, FolderClass foldClass, FolderLocation foldLocation, OSType badgeSignature, OSType badgeType, Str63 name, Boolean replaceFlag);
extern pascal OSErr GetFolderDescriptor(FolderType foldType, Size descSize, FolderDesc *foldDesc);
extern pascal OSErr GetFolderTypes(UInt32 requestedTypeCount, UInt32 *totalTypeCount, FolderType *theTypes);
extern pascal OSErr RemoveFolderDescriptor(FolderType foldType);
extern pascal OSErr FindFolderFSObject(FolderType foldType, Boolean createFolder, FSObjectRef *objectRef);
extern pascal OSErr NewFindFolder(short vRefNum, FolderType foldType, Boolean createFolder, short *foundVRefNum, long *foundDirID);
extern pascal OSErr InvalidateFolderDescriptorCache(short vRefNum, long dirID);
/* legacy routines */
extern pascal OSErr GetFolderName(short vRefNum, OSType foldType, short *foundVRefNum, StringPtr name);
/* routing routines */
extern pascal OSErr AddFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType routeToFolder, RoutingFlags flags, Boolean replaceFlag);
extern pascal OSErr RemoveFolderRouting(OSType fileType, FolderType routeFromFolder);
extern pascal OSErr FindFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType *routeToFolder, RoutingFlags *flags);
extern pascal OSErr GetFolderRoutings(UInt32 requestedRoutingCount, UInt32 *totalRoutingCount, Size routingSize, FolderRouting *theRoutings);
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=reset
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import off
#endif
#ifdef __cplusplus
}
#endif
#endif /* __FOLDERS__ */